With the development of network technologies, functions of network devices are more diversified, and it is more necessary to analyze and monitor network traffic. Currently, a network is controlled primarily by monitoring traffic and packets by using the network devices. Different network devices place emphasis on different aspects of packet processing, and support different bandwidths. Therefore, various network devices generally need to be grouped into a cluster at the time of deployment, so that each network device in a same cluster may meet a packet processing requirement by means of collaborative analysis between each other. In this deployment, a packet may need to be diverted between network devices in the same cluster, so that a specific analysis requirement is processed by a specific network device. If the packet needs to be processed by multiple network devices in the cluster in turn, the packet needs to be diverted multiple times. Diversion refers to delivering a packet from one network device to another network device for processing, so that the another network device returns the packet after completion of the processing.
In the prior art, a virtual local area network (Vlan, Virtual Local Area Network) header is generally added in an original packet to implement that the packet is diverted between different network devices multiple times. Primarily, different meanings are defined for different fields in the Vlan header, and multi-diversion information is stored in the Vlan header. At the time of diverting, the Vlan header is added to the original packet. After receiving a packet with the Vlan header, each network device may know, through performing parsing processing on the Vlan header, which device the packet is to be diverted to, and how to divert the packet, thereby implementing that the packet is diverted between the network devices multiple times. One layer of Vlan header may carry 12-bit (bit) information. If more multi-diversion information needs to be carried, another layer of Vlan header needs to be added.
However, an existing standard protocol only supports a packet with two layers of Vlan header at most. In this way, 24-bit multi-diversion information may be carried at most, and carried multi-diversion information is rather limited.